﻿<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="LightningTools.BCSTesterMan.MainWindow" xmlns:views="clr-namespace:LightningTools.BCSTesterMan.View" xmlns:ViewModel="clr-namespace:LightningTools.BCSTesterMan.ViewModel;assembly=LightningTools.BCSTesterMan.ViewModel" Title="BCS Tester Man by Lightning Tools Ltd" Icon="Images\logo.png" WindowStyle="ThreeDBorderWindow" Height="768" Width="1024">
	<Window.DataContext>
		<ViewModel:MainWindowViewModel />
	</Window.DataContext>
	<Window.Resources>

		<Style x:Key="ErrorViewStyle" TargetType="views:ErrorView">
			<Style.Triggers>
				<DataTrigger Binding="{Binding IsError, UpdateSourceTrigger=PropertyChanged}" Value="false">
					<Setter Property="GroupBox.Visibility" Value="Collapsed" />
				</DataTrigger>
			</Style.Triggers>
		</Style>

		<Style x:Key="MethodDetailViewStyle" TargetType="views:MethodDetailView">
			<Style.Triggers>
				<DataTrigger Binding="{Binding IsMethodSelected, UpdateSourceTrigger=PropertyChanged}" Value="false">
					<Setter Property="GroupBox.Visibility" Value="Collapsed" />
				</DataTrigger>
			</Style.Triggers>
		</Style>

		<Style x:Key="EntityDetailViewStyle" TargetType="views:EntityDetailView">
			<Style.Triggers>
				<DataTrigger Binding="{Binding IsEntitySelected, UpdateSourceTrigger=PropertyChanged}" Value="false">
					<Setter Property="GroupBox.Visibility" Value="Collapsed" />
				</DataTrigger>
			</Style.Triggers>
		</Style>

	</Window.Resources>

	<Border CornerRadius="5" BorderBrush="SteelBlue" BorderThickness="2">
		<Grid>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" MinWidth="300" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>

			<Grid.RowDefinitions>
				<RowDefinition Height="Auto" />
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>

			<Border Margin="8" Grid.Row="1" BorderThickness="2" BorderBrush="#FF00BEEF">

				<views:BcsView />

			</Border>

			<Border Margin="8" Grid.Column="1" Grid.Row="1" BorderThickness="2" BorderBrush="#FF00BEEF">
				<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
					<Grid>
						<views:MethodDetailView Style="{StaticResource MethodDetailViewStyle}" />
						<views:ErrorView Style="{StaticResource ErrorViewStyle}" />
						<views:EntityDetailView Style="{StaticResource EntityDetailViewStyle}" />
					</Grid>
				</ScrollViewer>
			</Border>
		</Grid>
	</Border>
</Window>